<?php

namespace app\model;

use app\model\AdminsModel;
use app\model\UsersModel;

class OperationLogModel extends BaseModel
{
    /**
     * 与模型关联的表名
     *
     * @var string
     */
    protected $table = 'operation_logs';


    protected $casts = [
        'created_at' => 'timestamp',
        'updated_at' => 'timestamp',
        'request_data' => 'array'
    ];

    /**
     * 关联用户
     */
    public function user()
    {
        return $this->belongsTo(UsersModel::class, 'user_id');
    }
}